﻿
    <UserControl x:Class="EzDesk.DesktopClient.View.LoginView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300"
                 Background="#01000000"
                 MouseLeftButtonDown="Grid_MouseLeftButtonDown"
                 >
    <UserControl.Resources>
        <Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource LabelStyle}">
        </Style>
        <Style  TargetType="{x:Type CheckBox}" BasedOn="{StaticResource CheckBoxStyle}">
        </Style>
    </UserControl.Resources>
        <Grid HorizontalAlignment="Center" VerticalAlignment="Center"  MinWidth="220" MouseLeftButtonDown="Grid_MouseLeftButtonDown"  >
        <StackPanel  IsEnabled="{Binding IsViewEnable}">

            <TextBlock Text="{StaticResource ResourceKey=UserName/Email}" Margin="2" ></TextBlock>
            <TextBox x:Name="UserName_Tbx" Text="{Binding UserName}" Margin="2,2,2,12" KeyUp="UserName_Tbx_KeyDown" ></TextBox>
            <TextBlock Text="{StaticResource ResourceKey=Password}" Margin="2"  ></TextBlock>
            <PasswordBox x:Name="Password_Tbx" Margin="2,2,2,12"  KeyUp="UserName_Tbx_KeyDown" ></PasswordBox>

            <!--<TextBlock x:Name="LoginMessage_Tbx" Visibility="Hidden" Foreground="Red" FontWeight="Bold" Margin="2,2,2,12" Text="{StaticResource LoginFailed}" ></TextBlock>-->
            <TextBlock x:Name="LoginMessage_Tbx" Visibility="Hidden" Foreground="Red" FontWeight="Bold" Margin="2,2,2,12" Text="{Binding ErrorMessage}" ></TextBlock>

            <!--<CheckBox x:Name="RememberPassword_Chk" Content="{StaticResource ResourceKey=RememberPassword}"  Margin="2"></CheckBox>
            <CheckBox x:Name="AutoLogin_Chk" Content="{StaticResource ResourceKey=AutoLogin}" Margin="2,2,2,12"  ></CheckBox>-->
            <Button x:Name="Login_Btn" Click="OnLogin_Btn_Click" Content="{StaticResource ResourceKey=Login}" VerticalAlignment="Center" Width="120" Margin="2,2,2,12"  ></Button>
            <Button x:Name="ClearLocalDB" Click="ClearLocalDB_Click"  Content="{StaticResource ResourceKey=ClearDB}" VerticalAlignment="Center" Width="120" Margin="2,2,2,12" ></Button>
            

            <TextBlock Margin="2"  x:Name="ForgetPassword_Tbk"  TextAlignment="Center" >
               <Hyperlink>
                   <Run Text="{StaticResource ResourceKey=ForgetPassword}"></Run>
                   </Hyperlink>
            </TextBlock>
            <TextBlock Text="{Binding ServiceLocation}" HorizontalAlignment="Center" ></TextBlock>
        </StackPanel>
    </Grid>
</UserControl>
